import zrender from 'zrender/zrender'
import Heart from 'zrender/graphic/shape/Heart'

export default {
  mounted() {
    const zr = zrender.init(this.$refs.chart)
    const shape = new Heart({
      shape: {
        cx : 450,
        cy : 150,
        r : 100,
        r0 : 50,
        startAngle: 0,
        endAngle: Math.PI * 2,
        clockwise: true
      },
      style: {
        brushType : 'both',
        color: 'red',
        stroke: 'green',
        lineWidth : 8,
        lineJoin : 'round',
        text:'sector'
      },
      draggable : true
    })
    zr.add(shape)
  },

  render(h) {
    return (
      <div class="page">
        <div ref="chart" style="width: 100%; height: 600px"></div>
      </div>
    )
  }
}
